import Vue from 'vue'
import { getModuleName } from '@/utils/importAll'

const reqCpt = require.context('./', true, /\.vue$/)
const install = () => {
  reqCpt.keys().forEach(name => {
    const cpt = reqCpt(name)
    const cptName = getModuleName(name)
    Vue.component(cptName, cpt.default)
  })
}
export default install
